﻿Imports Microsoft.Reporting.WebForms
Public Class ReporteEquipoMAC
    Inherits System.Web.UI.Page

    Dim strMAC As String

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
       
    End Sub

    Private Sub principal(ByVal strMAC As String)
        Me.ReportViewer1.LocalReport.ReportPath = ("reportes\ReporteEquiposMAC.rdlc")
        Me.ReportViewer1.LocalReport.DataSources.Clear()

        Dim adapter As New DataSetTableAdapters.USP_CONSULTA_TB_EQUIPO_X_MACTableAdapter
        Dim table As New DataSet.USP_CONSULTA_TB_EQUIPO_X_MACDataTable

        'adapter.FillTb_Equipo(table, strIP, strMAC, strNombre)
        'adapter.FillTb_Equipo(table, strIP, strMAC)
        adapter.FillX_MAC(table, strMAC)

        Me.ReportViewer1.LocalReport.DataSources.Add(New ReportDataSource("DataSet1", CType(table, DataTable)))
        Me.ReportViewer1.DataBind()
    End Sub

    Protected Sub btnConsultar_Click(sender As Object, e As EventArgs) Handles btnConsultar.Click
        If txtMAC.Text.Length = 0 Then
            strMAC = Nothing
        Else
            strMAC = txtMAC.Text
        End If
        principal(strMAC)
    End Sub
End Class